#ifndef JOB_H
#define JOB_H

#include "Block.h"
#include <string>
#include <vector>

using namespace std;

class CrackRequest {
private:
	string hash;
	vector<Block> blocks;
	bool complete;
	string password;
	unsigned int connID;
	bool result_sent;

public:
	CrackRequest(unsigned int connID, string hash, string lower, string upper, unsigned int& next_blockid);
	bool is_complete();
	unsigned int get_connID() const {return connID;}
	string get_hash() const {return hash;}
	Block& block(int index) {return blocks[index];} 
	int num_blocks() const {return blocks.size();}
	int num_in_work() const;
	string get_block_for_worker(unsigned int& block_id);
	bool set_password(string new_password);
	string get_result_string();
};

#endif
